package com.briup.cms.service.impl;

import com.briup.cms.bean.Config;
import com.briup.cms.dao.ConfigMapper;
import com.briup.cms.service.IConfigService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

@Service

public class ConfigServiceImpl  implements IConfigService {
    @Resource
    private ConfigMapper configMapper;

    @Override
    public List<Config> findAll() {
        return configMapper.selectAll();
    }

    @Override
    public void saveOrUpdate(Config config) {
        if(config.getId()!=null){
            configMapper.update(config);
        }

        else {
            configMapper.insert(config);
        }
    }
    @Override
    public void deleteById(Long id) {
        configMapper.deleteById(id);
    }

}
